var globalService = angular.module('globalService', []);

globalService.factory('_$toast', [function() {
	return {
		showShortTop: function(message) {
			if (typeof cordova != "undefined") {
				window.plugins.toast.showShortTop(message);
			} else {
				alert(message);
			}
		},
		showShortCenter: function(message) {
			if (typeof cordova != "undefined") {
				window.plugins.toast.showShortCenter(message);
			} else {
				alert(message);
			}
		},
		showShortBottom: function(message) {
			if (typeof cordova != "undefined") {
				window.plugins.toast.showShortBottom(message);
			} else {
				alert(message);
			}
		},
		showLongTop: function(message) {
			if (typeof cordova != "undefined") {
				window.plugins.toast.showLongTop(message);
			} else {
				alert(message);
			}
		},
		showLongCenter: function(message) {
			if (typeof cordova != "undefined") {
				window.plugins.toast.showLongCenter(message);
			} else {
				alert(message);
			}
		},
		showLongBottom: function(message) {
			if (typeof cordova != "undefined") {
				window.plugins.toast.showLongBottom(message);
			} else {
				alert(message);
			}
		}
	}
}]);